/*
 * Copyright (c) 2008-2021 浩瀚深度 All Rights Reserved.
 *
 * <p>FileName: WeChatService.java</p>
 *
 * @author zz
 * @date 2024/4/26
 * @version 1.0
 * History:
 * v1.0.0 2024/4/26 Create
 */
package com.jason.zax.service;

import com.riversoft.weixin.open.base.AppSetting;
import com.riversoft.weixin.open.oauth2.OpenOAuth2s;
import org.springframework.stereotype.Service;

/**
 * <p>Title: WeChatService</p>
 * <p>Description: </p>
 *
 * @author zz
 */
@Service
public class WeChatService {

    public static void main(String[] args) {

        AppSetting appSetting = new AppSetting("wxde2c4a4cde4e66ce", "ec535d17244d03e7acd4a31ab85bca27");
        //生成授权链接,默认scope: snsapi_base
        String authUrl = OpenOAuth2s.with(appSetting).authenticationUrl("url");
        System.out.println("snsapi_base授权链接:" + authUrl);
        //生成授权链接,指定scope: snsapi_base or snsapi_userinfo
        String authSCopUrl = OpenOAuth2s.with(appSetting).authenticationUrl("url", "snsapi_base");
        System.out.println("authSCopUrl授权链接:" + authSCopUrl);

    }
}
